package cn.zwk.product.feign;

import cn.zwk.common.to.SkuReductionTo;
import cn.zwk.common.to.SpuBoundTo;
import cn.zwk.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("gulimall-coupon")
public interface CouponFeignService {
    /**
     * openFeign的远程调用会将请求参数封装成json格式
     * 再将json格式的请求体发送给远程服务
     * 由远程服务将json转化为请求参数
     * 所以我们这里的参数，并不一定非要和远程服务的controller方法参数一致
     */
    @RequestMapping("/coupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundTo spuBounds);


    @PostMapping("/coupon/skufullreduction/saveSkuReduction")
    R saveSkuReduction(@RequestBody SkuReductionTo reductionTo);
}
